package dq.study.apache.commons;

import com.taocares.commons.beans.BeanUtils;
import org.apache.commons.text.StringSubstitutor;

import java.util.HashMap;
import java.util.Map;

/**
 * @author dongqun
 * @date 2020/1/16 10:16
 */
public class Text {

    private static String startCheckInMessageTemplate = "您乘坐的${flightNo}航班已经开始办理值机，请前往值机柜台${operationBarNo}办理值机。";


    public static void main(String[] args){
        Bean bean = new Bean();
        bean.setFlightNo("CA1299");
//        bean.setOperationBarNo("sns");

        Map<String,String> beanMap = new HashMap<>();
        BeanUtils.copyProperties(bean,beanMap);

        StringSubstitutor substitutor = new StringSubstitutor(beanMap);
        System.out.println(substitutor.replace(startCheckInMessageTemplate));
    }
}
